var  labelBottom = {
    normal : {
        color: '#fff',
        label : {
            show : true,
            position : 'center',
            formatter : '{b}',
            textStyle: {
                baseline : 'bottom'
            }
        },
        labelLine : {
            show : false
        }
    }
};
var labelFromatter = {
    normal : {
        label : {              
            textStyle: {             
                color: '#000000',
                baseline : 'top'
            }
        }
    },
}
var labelTop1 = {
  
    normal : {    
        color: '#F55C5F',
        label : {            
            show : true,
            position : 'center'
        },
        labelLine : {
            show : false
        }
    },
};
var labelTop2 = {
  
    normal : {    
        color: '#559BCE',
        label : {            
            show : true,
            position : 'center'
        },
        labelLine : {
            show : false
        }
    },
};
var labelTop3 = {
  
    normal : {    
        color: '#24AE94',
        label : {            
            show : true,
            position : 'center'
        },
        labelLine : {
            show : false
        }
    },
};
var labelTop4 = {
  
    normal : {    
        color: '#FE8661',
        label : {            
            show : true,
            position : 'center'
        },
        labelLine : {
            show : false
        }
    },
};
var labelTop8 = {
  
    normal : {    
        // color: ['#F4736E','#FDD158'],
        label : {            
            show : true,
            position : 'center'
        },
        labelLine : {
            show : false
        }
    },
};
var  labelBottom8 = {
    normal : {
        // color: ['#9CE8F6','#BEE585'],
        label : {
            show : true,
            position : 'center',
            formatter : '{b}',
            textStyle: {
                baseline : 'bottom'
            }
        },
        labelLine : {
            show : false
        }
    }
};
var radius = [22, 25];
var radius1 = [20, 50];


// 路径配置
require.config({
    paths: {
        echarts: 'http://echarts.baidu.com/build/dist'
    }
});

// 使用
require(
    [
        'echarts',
        'echarts/chart/pie' // 使用柱状图就加载bar模块，按需加载
    ],
    function (ec) {
        // 基于准备好的dom，初始化echarts图表
        var myChart1 = ec.init(document.getElementById('zijin'));
        var myChart2 = ec.init(document.getElementById('xuncha'));
        var myChart3 = ec.init(document.getElementById('guanhu'));
        var myChart4 = ec.init(document.getElementById('weixiu'));
        //quanshi daofu yu_e
        var myChart5 = ec.init(document.getElementById('quanshi'));
        var myChart6 = ec.init(document.getElementById('daofu'));
        var myChart7 = ec.init(document.getElementById('yu_e'));
        //资金分配情况 zijifenpei
        var myChart8 = ec.init(document.getElementById('zijifenpei'));

        var option1 = {
            series: [{
                    type: 'pie',
                    center: ['50%', '50%'],
                    radius: radius,
                    y: '15%',
                    x: '10%',
                    itemStyle: labelFromatter,
                    data: [
                        {
                            name: '资金元',
                            value: 75,
                            itemStyle: labelTop1
                        },
                        {
                            name: '5000',
                            value: 25,
                            itemStyle: labelBottom 
                        },


                    ]
                }
            ]
        };
        var option2 = {
            series: [{
                    type: 'pie',
                    center: ['50%', '50%'],
                    radius: radius,
                    y: '15%',
                    x: '10%',
                    itemStyle: labelFromatter,
                    data: [
                        {
                            name: '巡查次',
                            value: 75,
                            itemStyle: labelTop2
                        },
                        {
                            name: '5',
                            value: 25,
                            itemStyle: labelBottom 
                        },


                    ]
                }
            ]
        };
        var option3 = {
            series: [{
                    type: 'pie',
                    center: ['50%', '50%'],
                    radius: radius,
                    y: '15%',
                    x: '10%',
                    itemStyle: labelFromatter,
                    data: [
                        {
                            name: '管护次',
                            value: 75,
                            itemStyle: labelTop3
                        },
                        {
                            name: '24',
                            value: 25,
                            itemStyle: labelBottom 
                        },


                    ]
                }
            ]
        };
        var option4 = {
            series: [{
                    type: 'pie',
                    center: ['50%', '50%'],
                    radius: radius,
                    y: '15%',
                    x: '10%',
                    itemStyle: labelFromatter,
                    data: [
                        {
                            name: '维护次',
                            value: 75,
                            itemStyle: labelTop4
                        },
                        {
                            name: '24',
                            value: 25,
                            itemStyle: labelBottom 
                        },


                    ]
                }
            ]
        };
        var option5 = {
            series: [{
                    type: 'pie',
                    center: ['50%', '50%'],
                    radius: radius,
                    y: '15%',
                    x: '10%',
                    itemStyle: labelFromatter,
                    data: [
                        {
                            name: '全市',
                            value: 75,
                            itemStyle: labelTop1
                        },
                        {
                            name: '5000',
                            value: 25,
                            itemStyle: labelBottom 
                        },


                    ]
                }
            ]
        };
        var option6 = {
            series: [{
                    type: 'pie',
                    center: ['50%', '50%'],
                    radius: radius,
                    y: '15%',
                    x: '10%',
                    itemStyle: labelFromatter,
                    data: [
                        {
                            name: '拨付',
                            value: 75,
                            itemStyle: labelTop2
                        },
                        {
                            name: '2600',
                            value: 25,
                            itemStyle: labelBottom 
                        },


                    ]
                }
            ]
        };
        var option7 = {
            series: [{
                    type: 'pie',
                    center: ['50%', '50%'],
                    radius: radius,
                    y: '15%',
                    x: '10%',
                    itemStyle: labelFromatter,
                    data: [
                        {
                            name: '余额',
                            value: 75,
                            itemStyle: labelTop3
                        },
                        {
                            name: '2400',
                            value: 25,
                            itemStyle: labelBottom 
                        },


                    ]
                }
            ]
        };
        var option8 = {
        	        	    title : {
        text: '单位:万元',
        x:'right',
        textStyle:{
　　　　 fontSize:12
    }

    },
       
            legend: {
                orient : 'vertical',
                x : 'right',
                y:'center',
                data:['港渠','涵闸','泵站','水库']
            },
            tooltip : {
                trigger: 'item',
                formatter: "{a} <br/>{b} : {c} ({d}%)"
            },
            series : [
                {
                    center: ['35%','45%'],
                    name:'资金',
                    type:'pie',
                    radius : ['50%', '70%'],
                    itemStyle : {
                        normal : {
                            label : {
                                show : false
                            },
                            labelLine : {
                                show : false
                            }
                        },
                        emphasis : {
                            label : {
                                show : false,
                                position : 'center',
                                textStyle : {
                                    fontSize : '30',
                                    fontWeight : 'bold'
                                }
                            }
                        }
                    },
                    data:[
                                               {
                            name: '泵站',
                            value: 35,
                        },
                        {
                            name: '涵闸',
                            value: 35,
                        },
                        {
                            name: '水库',
                            value: 15,
                        },
                        {
                            name: '港渠',
                            value:15,
                        }
                    ]
                }
            ]
        };
        // 为echarts对象加载数据 
        myChart1.setOption(option1);
        myChart2.setOption(option2);
        myChart3.setOption(option3);
        myChart4.setOption(option4);
        myChart5.setOption(option5);
        myChart6.setOption(option6);
        myChart7.setOption(option7);
        myChart8.setOption(option8);
    }
);